exports.CreateRegisterPop = function(_args) {
    if(_args === undefined) _args = {};
    if(_args.title === undefined) _args.title = 'Popover';

	Ti.App.Properties.setString('login_username_email', '');
	Ti.App.Properties.setString('login_password', '');
		
		
    var win = Ti.UI.createWindow({
    	top:_args.top,
        width: Titanium.Platform.displayCaps.platformWidth,//320,
        height: Titanium.Platform.displayCaps.platformHeight,//480,
        opacity: 0
    });
    var btwidth=200;
	var btheight=45;
    var backgroundImage,arrowimage;
    var topfirst,leftfirst,leftsecond,heightlabel,right,heighttext,space,bgcolor='#020202'	

    if(Ti.Platform.osname== 'android') {
  		 backgroundImage= '../windows/images/popover/PopoverPortrait.png';
  		 arrowimage='../windows/images/popover/PopoverPortraitArrow.png';
  		 Titanium.include('../globals.js');
  		 Titanium.include('../cs/cs.js');
  		 Titanium.include('../windows/ModalActivityIndicatorWindow.js');
  		 topfirst=30,leftfirst=40,leftsecond=200,heightlabel=21,right=40,heighttext=50,space=10
    }
    else {
   		  backgroundImage= 'windows/images/popover/PopoverPortrait.png';
   		  arrowimage='windows/images/popover/PopoverPortraitArrow.png';
   		  Titanium.include('globals.js');
   		  topfirst=30,leftfirst=40,leftsecond=200,heightlabel=21,right=40,heighttext=31,space=10
	
    }
    
    
    
    var fakeWin = Ti.UI.createView({
        width: Titanium.Platform.displayCaps.platformWidth,//300,
        height: Titanium.Platform.displayCaps.platformHeight,//350,
        top:0,// 65,
      //  backgroundImage: Globals.backgroundImage_PanelImageView//backgroundImage,
        backgroundImage:Globals.backgroundImage_PanelHeaderBuyDetail,
    });
    win.add(fakeWin);

    win.addEventListener('close', function() {
        win = null;
    });

    win.addEventListener('click', function(e) {
        //alert(e.source);
        if(e.source === win) {
            win.close();
        }
    });

    var view = Ti.UI.createView({
        width:Titanium.Platform.displayCaps.platformWidth,//-100,
        height:800,
        top: 40,
       
        backgroundColor: 'white',
        borderRadius: 8,
       // backgroundImage:Globals.backgroundImage_PanelHeaderBuyDetail,
    });
    fakeWin.add(view);

    fakeWin.add(Ti.UI.createLabel({
        text: _args.title,
        color:"#fff",
        textAlign:"center",
        height: 'auto',
        top: 10,
        font:{fontSize:18,fontWeight:"bold"}
    }));
/*
    if(_args.view !== undefined) {
        _args.view.top = 0;
        _args.view.left = 0;
        _args.view.bottom = 0;
        _args.view.right = 0;
        _args.view.borderRadius = 8;
        _args.view.width = 280;
        _args.view.height = 300;
        view.add(_args.view);
    }
*/
	/*
    var arrow = Ti.UI.createImageView({
        width: 40,
        height: 20,
        top: 49,
        image:arrowimage
    });
    win.add(arrow);

    if(_args.left !== undefined && arrow.right === undefined) {
        arrow.left = _args.left;
    }

    if(_args.right !== undefined && arrow.left === undefined) {
        arrow.right = _args.right;
    }

    if(arrow.right === undefined && arrow.left === undefined) {
        arrow.left = 15;
    }
	*/
    _args.view.open = function() {
        win.open();
        var a1 = Titanium.UI.createAnimation();
        a1.opacity = 1;
        a1.duration = 300;
        win.animate(a1);
    };

    _args.view.close = function() {
        win.hide();
    };




	/////////////////////// HEADER 1 ///////////////////
	var lbHeader1= Titanium.UI.createLabel({
	    left: leftfirst,
	    right:	right,
	    top: topfirst	,
	    width:'auto',
	    color: bgcolor	,
	    text: 'THÔNG TIN THÀNH VIÊN',
		font:{
								fontSize:Ti.App.Properties.getString('fontsizeDefault'),
								fontWeight:'bold'
			},
	});
	view.add(lbHeader1);
	/////////////////////// ROW 1///////////////////
  	var lbHoTen= Titanium.UI.createLabel({
	    left: leftfirst,
	    top: topfirst+ heighttext 	,
	    height: heightlabel,
	    text: 'Họ tên',
	   
	    color: bgcolor	,
	    font: {fontFamily: 'Helvetica', fontSize: Ti.App.Properties.getString('fontsizeDefault')}
	});
	view.add(lbHoTen);
	var txtHoTen = Titanium.UI.createTextField({
	    borderStyle: Titanium.UI.INPUT_BORDERSTYLE_ROUNDED,
	    left: leftsecond,
	    top: topfirst+ heighttext 	,
	    right:	right,
	    height: heighttext,
	    value: '',
	    hintText: 'Nhập họ và tên',
	    font: {fontFamily: 'Helvetica', fontSize: Ti.App.Properties.getString('fontsizeDefault')},
	    color: bgcolor	,
	});
	view.add(txtHoTen);
	/////////////////////// ROW 2///////////////////
	var lbNoiQuy= Titanium.UI.createLabel({
	    left: leftfirst,
	    right:	right,
	    top: topfirst + (heighttext*2) 	,
	    width:'auto',
	   // height: 'auto'		,
	    backgroundColor: '#ffffff',
	    text: 'Chúng tôi có thể xóa tài khoản của bạn nếu tên thật của bạn không nghiêm túc và không đúng quy định',
	    color: '#fb0000'
	});
	view.add(lbNoiQuy);
	
	/////////////////////// ROW 3///////////////////
	var lbGioiTinh= Titanium.UI.createLabel({
	    left: leftfirst,
	    top: topfirst+ (heighttext*3)+15,
	    height: heightlabel,
	    text: 'Giới tính',
	    color: bgcolor	,
	    font: {fontFamily: 'Helvetica', fontSize: Ti.App.Properties.getString('fontsizeDefault')}
	});
	view.add(lbGioiTinh);
	var txtGioiTinh;
	var buttons = ['Nam', 'Nữ'];
	var SexIndex=1;
	if(Ti.Platform.osname != 'android')
	{
		txtGioiTinh = Titanium.UI.createTabbedBar({
		    labels:buttons,
		   // backgroundColor:'#336699',
		    left: leftsecond,
		    top: topfirst+ (heighttext*3)+15,
		    style:Titanium.UI.iPhone.SystemButtonStyle.BAR,
		    height: heighttext,
		    width:200,
		    index:0,
		});
		txtGioiTinh.addEventListener('click',function(e)
		{
			if(e.index==1)
				SexIndex=2;	
			else 	SexIndex=1;	
				//alert(SexIndex)
		})
		
		
	}
	else
	{
	  var index_=0;
	   if(_args.isRegister == '0') {
	  	 
		  if(Ti.Platform.osname == 'android') {
		   		if(Ti.App.Properties.getString('login_Sex')!=1)
		   		{
		   			index_=1;
		   		}
		   }
		}
	 
		var myCB = function (idx) {
			if(buttons[idx]=='Nữ')
				SexIndex=2;	
			else 	SexIndex=1;	
				//alert(SexIndex)
		 // alert(buttons[idx]+' is the coolest');
		}
		txtGioiTinh = require('settings').makeTabbedBar({
			labels:buttons, 
			left: leftsecond,
			width:100,
			top: topfirst+ (heighttext*3)+15,
			/* CUSTOM PROPERTIES TO SET BACKGROUND IMAGES ON ANDROID */
			androidBackgroundImage: '/images/SegmentedControlAndroidGradient.png',
			androidBackgroundSelectedImage: '/images/SegmentedControlAndroidSelectedGradient.png',
			index:index_
		}, 
		myCB);
	
	}
	 view.add(txtGioiTinh);
	/////////////////////// ROW 4///////////////////
	var lbNgaySinh= Titanium.UI.createLabel({
	    left: leftfirst,
	    top: topfirst+ (heighttext*4)+15+space,
	    height: heightlabel,
	    text: 'Ngày sinh',
	   
	    color: bgcolor	,
	    font: {fontFamily: 'Helvetica', fontSize:  Ti.App.Properties.getString('fontsizeDefault')}
	});
	view.add(lbNgaySinh);
	
	
	
	
		////////////////////
			
	var tr = Titanium.UI.create2DMatrix();
		tr = tr.rotate(90);
		
		var drop_button =  Titanium.UI.createButton({
				style:Titanium.UI.iPhone.SystemButton.DISCLOSURE,
				transform:tr
		});

	
	var txtNgaySinh = Titanium.UI.createTextField({
		    borderStyle: Titanium.UI.INPUT_BORDERSTYLE_ROUNDED,
		    left: leftsecond,
		    top: topfirst+ (heighttext*4)+15+space,
		    right:	right,
		    height: heighttext,
		    value: '',
		    hintText: 'Nhập ngày sinh',
		    color: bgcolor	,
		    font: {fontFamily: 'Helvetica', fontSize: Ti.App.Properties.getString('fontsizeDefault')},
		    rightButton:drop_button,
			rightButtonMode:Titanium.UI.INPUT_BUTTONMODE_ALWAYS
	});
	
	
	
	

	
		
		txtNgaySinh.addEventListener('focus',function(e){
			var currentTime = new Date();
			var month = currentTime.getMonth() + 1;
			var day = currentTime.getDate();
			var year = currentTime.getFullYear();
				
				
			if(Ti.Platform.osname== 'android') {//ANDROID
				
		  		Ti.UI.Android.hideSoftKeyboard();
				var picker = Ti.UI.createPicker({
				  type:Ti.UI.PICKER_TYPE_DATE,
			      minDate: new Date(1900,0,1),
			      maxDate: new Date(year,month,day),
			      value: new Date(year,month,day),
			        
			        
				});
				//view.add(picker);
				picker.showDatePickerDialog({
				  value: new Date(2010,8,1),
				  callback: function(e) {
				    if (e.cancel) {
				      //alert('User canceled dialog');
				    } else {
				     // alert('User selected date: ' + e.value);
				      var timeFormatted;
						timeFormatted = dateFormat(e.value, "mm/dd/yyyy");
						txtNgaySinh.setValue(timeFormatted);
				    }
				  }
				});
			}
			else//IOS
			{
				
				Titanium.API.info('Triggered focus on date txtFeild');
			    txtNgaySinh.blur();
			    //create a pop over
			    var ddPO = Titanium.UI.iPad.createPopover({
			        width: '320',
			        height: 145,
			        navBarHidden: true,
			        arrowDirection: Titanium.UI.iPad.POPOVER_ARROW_DIRECTION_UP
			    });
			 
			  
			 
			 
			 
			 
			 
			    var datePicker = Ti.UI.createPicker({
			        type:Ti.UI.PICKER_TYPE_DATE,
			       
			        
			        minDate: new Date(1900,0,1),
			   		maxDate: new Date(year,month,day),
			    	value: new Date(year,month,day),
			        
			      
			    });
			    datePicker.addEventListener('change',function(e){
					///////////////////////////////////////
					timeValue = new Date(e.value);
				
					var timeFormatted;
					timeFormatted = dateFormat(timeValue, "mm/dd/yyyy");
					txtNgaySinh.setValue(timeFormatted);
					///////////////////////////////////////
			    });
			    ddPO.add(datePicker);
			 
			    // turn on the selection indicator (off by default)
			    datePicker.selectionIndicator = true;
			 
			    ddPO.show({ view: txtNgaySinh,animated: true});   
			    
			   
			   
			 
			   
							   
				
			
			}
			
			
			
		              
		}); 

	
	
	
	
	
	
		
	
	
	if(Codestrong.isAndroid()) {
		Ti.include(
		"../lib/dateFormat.js",
		"../lib/createDatePickerWin.js"
	);
	}//Titanium.include('../globals.js');
    else 	{
    	Ti.include(
		"lib/dateFormat.js",
		"lib/createDatePickerWin.js"
	);
    }
	
	
	view.add(txtNgaySinh);
	
	
	
	/////////////////////// ROW 5///////////////////
	var lbDiaChi= Titanium.UI.createLabel({
	    left: leftfirst,
	    top: topfirst+ (heighttext*5)+15+(space*2),
	    height: heightlabel,
	    text: 'Địa chỉ',
	  
	    color: bgcolor	,
	    font: {fontFamily: 'Helvetica', fontSize:  Ti.App.Properties.getString('fontsizeDefault')}
	});
	view.add(lbDiaChi);
	
	var txtDiaChi = Titanium.UI.createTextField({
	    borderStyle: Titanium.UI.INPUT_BORDERSTYLE_ROUNDED,
	    left: leftsecond,
	    top: topfirst+ (heighttext*5)+15+(space*2),
	    right:	right,
	    height: heighttext,
	    value: '',
	    hintText: 'Nhập địa chỉ',
	    color: bgcolor	,
	    font: {fontFamily: 'Helvetica', fontSize: Ti.App.Properties.getString('fontsizeDefault')}
	});
	view.add(txtDiaChi);
	
	
	/////////////////////// HEADER 2 ///////////////////
	var lbHeader1= Titanium.UI.createLabel({
	    left: leftfirst,
	    right:	right,
	    top: topfirst+ (heighttext*6)+15+(space*3),
	    width:'auto',
	   // height: 'auto'		,
		color: bgcolor	,
	    text: 'CHỌN TÊN ĐĂNG NHẬP VÀ MẬT KHẨU',
	  	font:{
								fontSize:Ti.App.Properties.getString('fontsizeDefault'),
								fontWeight:'bold'
			},
	});
	view.add(lbHeader1);
    /////////////////////// ROW 7///////////////////
	var lbEmail= Titanium.UI.createLabel({
	    left: leftfirst,
	    top: topfirst+ (heighttext*7)+15+(space*4),
	    height: heightlabel,
	    text: 'Email (*)',
	    color: bgcolor	,
	    font: {fontFamily: 'Helvetica', fontSize: Ti.App.Properties.getString('fontsizeDefault')}
	});
	view.add(lbEmail);
	
	var txtEmail = Titanium.UI.createTextField({
	    borderStyle: Titanium.UI.INPUT_BORDERSTYLE_ROUNDED,
	    left: leftsecond,
	    top: topfirst+ (heighttext*7)+15+(space*4),
	    right:	right,
	    height: heighttext,
	    value: '',
	    hintText: 'Nhập địa chỉ hộp thư của bạn',
	    color: bgcolor	,
	    font: {fontFamily: 'Helvetica', fontSize: Ti.App.Properties.getString('fontsizeDefault')}
	});

	view.add(txtEmail);
	/////////////////////// ROW 8///////////////////
	var lbNoiQuyEmail= Titanium.UI.createLabel({
	    left: leftfirst,
	    right:	right,
	    top: topfirst+ (heighttext*8)+15+(space*5),
	    width:'auto',
	   // height: 'auto'		,
	    backgroundColor: '#ffffff',
	    text: 'Email này được dùng để đăng nhập vào hệ thống của thaytro.vn và nhận thông báo hay tin tức khuyến mãi từ thaytro.vn',
	    color: '#fb0000'
	});
	view.add(lbNoiQuyEmail);
   /////////////////////// ROW 9///////////////////
	var lbUser= Titanium.UI.createLabel({
	    left: leftfirst,
	    top: topfirst+ (heighttext*9)+20+(space*6),
	    height: heightlabel,
	    text: 'Tên đăng nhập (*)',
	    color: bgcolor	,
	    font: {fontFamily: 'Helvetica', fontSize: Ti.App.Properties.getString('fontsizeDefault')}
	});
	view.add(lbUser);
	
	var txtUser = Titanium.UI.createTextField({
	    borderStyle: Titanium.UI.INPUT_BORDERSTYLE_ROUNDED,
	    left: leftsecond,
	    top: topfirst+ (heighttext*9)+20+(space*6),
	    right:	right,
	    height: heighttext,
	    value: '',
	    hintText: 'Nhập tên đăng nhập bạn muốn sử dụng',
	    color: bgcolor	,
	    font: {fontFamily: 'Helvetica', fontSize: Ti.App.Properties.getString('fontsizeDefault')}
	});
	view.add(txtUser);
   
   /////////////////////// ROW 10///////////////////
	var lbPass= Titanium.UI.createLabel({
	    left: leftfirst,
	    top: topfirst+ (heighttext*10)+20+(space*7),
	    height: heightlabel,
	    text: 'Mật khẩu (*)',
	    color: bgcolor	,
	    font: {fontFamily: 'Helvetica', fontSize: Ti.App.Properties.getString('fontsizeDefault')},
	  
	});
	view.add(lbPass);
	
	var txtPass = Titanium.UI.createTextField({
	    borderStyle: Titanium.UI.INPUT_BORDERSTYLE_ROUNDED,
	    left: leftsecond,
	    top: topfirst+ (heighttext*10)+20+(space*7),
	    right:	right,
	    height: heighttext,
	    value: '',
	    hintText: 'Nhập mật khẩu bảo mật',
	    passwordMask:true,
	    color: bgcolor	,
	    font: {fontFamily: 'Helvetica', fontSize: Ti.App.Properties.getString('fontsizeDefault')},
	    keyboardType:Titanium.UI.KEYBOARD_DEFAULT,  
	    returnKeyType:Titanium.UI.RETURNKEY_DEFAULT,  
	
	});
	view.add(txtPass);
   
   /////////////////////// ROW 11///////////////////
	var lbPassAgain= Titanium.UI.createLabel({
	    left: leftfirst,
	    top: topfirst+ (heighttext*11)+20+(space*8),
	    height: heightlabel,
	    text: 'Nhập lại mật khẩu (*)',
	    color: bgcolor	,
	    font: {fontFamily: 'Helvetica', fontSize: Ti.App.Properties.getString('fontsizeDefault')}
	});
	view.add(lbPassAgain);
	
	var txtPassAgain = Titanium.UI.createTextField({
	    borderStyle: Titanium.UI.INPUT_BORDERSTYLE_ROUNDED,
	    left: leftsecond,
	    top: topfirst+ (heighttext*11)+20+(space*8),
	    right:	right,
	    height: heighttext,
	    value: '',
	 	passwordMask:true,
	    hintText: 'Nhập lại mật khẩu như trên',
	    color: bgcolor	,
	    font: {fontFamily: 'Helvetica', fontSize: Ti.App.Properties.getString('fontsizeDefault')},
	    keyboardType:Titanium.UI.KEYBOARD_DEFAULT,  
	    returnKeyType:Titanium.UI.RETURNKEY_DEFAULT,  
	
	});
	view.add(txtPassAgain);
	
	

	
	
	
	
	/////////////////////// ROW 12///////////////////
    var btRegister = Titanium.UI.createButton({
		title:Globals.register_register,
		font:{
								fontSize:Ti.App.Properties.getString('fontsizeDefault')//,
								//fontWeight:'bold'
			},
		backgroundImage:Globals.backgroundImage_button,
		backgroundSelectedImage:Globals.backgroundSelectedImage,
		backgroundDisabledImage: Globals.backgroundDisabledImage,
		width:btwidth	,
		height:btheight	,
		left: leftfirst	,
		
		top: topfirst+ (heighttext*12)+20+(space*9),
		color:Globals.foreColor
	});
	
	var getDate=function (){
		var currentTime = new Date();
		//var hours = currentTime.getHours();
		//var minutes = currentTime.getMinutes();
		var month = currentTime.getMonth() + 1;
		var day = currentTime.getDate();
		var year = currentTime.getFullYear();
		return month+'/'+day+'/'+year;
	}
	
	
	btRegister.addEventListener('click',function()
	{
		
		 if (Ti.Network.online) {
		 	///REGISTER
		 	if(btRegister.title==Globals.register_register)
		 	{
		 		    var FullName=txtHoTen.getValue();	
				 	var Sex=  SexIndex;
				 	var Birthday=getDate();
				 	var Address=txtDiaChi.getValue();	
				 	var Email=txtEmail.getValue();
				 	var UserName=txtUser.getValue();
				 	var Password=txtPass.getValue();
				 	var PasswordAgain=txtPassAgain.getValue();
				 	var Postdate=getDate();
				 	if(FullName=='')
				 	{
				 		require('settings').createAlertDialog(Globals.title,txtHoTen.getHintText());
				 		txtHoTen.focus();
				 		return
				 	}
				 	else if(Email=='')
				 	{
				 		require('settings').createAlertDialog(Globals.title,txtEmail.getHintText());
				 		txtEmail.focus();
				 		return
				 	}
				 	else if (!require('settings').checkemail(txtEmail.value))
					{
						require('settings').createAlertDialog(Globals.title,Globals.checkemailvalid);
				 		txtEmail.focus();
				 		return
					}
				 	else if(UserName=='')
				 	{
				 		require('settings').createAlertDialog(Globals.title,txtUser.getHintText());
				 		txtUser.focus();
				 		return
				 	}
				 	else if(Password=='')
				 	{
				 		require('settings').createAlertDialog(Globals.title,txtPass.getHintText());
				 		txtPass.focus();
				 		return
				 	}
				 	else if(PasswordAgain=='')
				 	{
				 		require('settings').createAlertDialog(Globals.title,txtPassAgain.getHintText());
				 		txtPassAgain.focus();
				 		return
				 	}
				 	else if(Password!=PasswordAgain)
				 	{
				 		require('settings').createAlertDialog(Globals.title,'Hai mật khẩu không trùng khớp, vui lòng nhập lại')	;
				 		txtPassAgain.focus();
				 		return
				 	}
				 	
			 		else
			 		{
			 			Codestrong.ui.activityIndicator.showModal(Globals.loading_createAccount, Globals.timeout, Globals.loadingTimeout);
			 			getRegisterUser(FullName,Sex,Birthday,Address,Email,UserName,Password,Postdate)
			 		}
		 	}
		 	//////UPDATE
		 	else
		 	{
		 		
		 	}
		 	
		 	
		 }
		 else
		 {
		  	   require('settings').createAlertConnectError();
		 }
	})
    view.add(btRegister);
    var btCancel = Titanium.UI.createButton({
		title:'Huỷ bỏ',
		font:{
								fontSize:Ti.App.Properties.getString('fontsizeDefault')//,
								//fontWeight:'bold'
			},
		backgroundImage:Globals.backgroundImage_button,
		backgroundSelectedImage:Globals.backgroundSelectedImage,
		backgroundDisabledImage: Globals.backgroundDisabledImage,
		width:btwidth	,
		height:btheight	,
		right: right	,
		top: topfirst+ (heighttext*12)+20+(space*9),
		color:Globals.foreColor
	});
	
	btCancel.addEventListener('click',function()
	{
		
		 win.close()
		
	})
    view.add(btCancel);
	var getRegisterUser = function(FullName,Sex,Birthday,Address,Email,UserName,Password,Postdate) {
	//activityIndicator.show();
	var row = null;
	var data = [];
	var param = {        
	  "FullName" : FullName,
	  "Sex": Sex,
	  "Birthday" : Birthday,
	  "Address": Address,
	  "Email" : Email,
	  "UserName": UserName,
	  "Password" : Password,
	  "Postdate": Postdate
	  
	};
	try {  	
	   	   var xhr = Titanium.Network.createHTTPClient({
		   onload : function(e) 
		   {
		         Titanium.API.info(this.responseText);
				 json = this.responseText;
				 json=json.replace('<string xmlns="http://tempuri.org/">', '');
				 json=json.replace('<?xml version="1.0" encoding="utf-8"?>', '');
				 json=json.replace('</string>', '');
				 //alert(FullName+','+Sex+','+Birthday+','+Address+','+Email+','+UserName+','+Password+','+Postdate)
				 // alert(json)
				 /*
				 response = JSON.parse(json);
			     //	alert(response.OBJECT.length);
			 	 for (i = 0; i < response.OBJECT.length; i++) {
						olecture = response.OBJECT[i];
						//alert(olecture.IdMon)
				}
				*/
				//alert(json)
				if(json==1)//sucessfull
				{
					require('settings').createAlertDialog(Globals.title,Globals.register_registersuccess);
					win.close();
				}
				else if(json==2)//email exits
				{
					require('settings').createAlertDialog(Globals.title,Globals.register_emailexits);
				}
				else{
					//erorr insert
					require('settings').createAlertDialog(Globals.title,Globals.register_error);
				}
				
				
				Codestrong.ui.activityIndicator.hideModal();
		   }, 
		   onerror : function(e) {
		   	 Codestrong.ui.activityIndicator.hideModal();
		   },
		   timeout : 5000
    
		});
		xhr.open("POST",Globals.serviceurl_RegisterUser);
		xhr.send(param);
		//return data;
	   		    
	 	} catch (e) {
	            Ti.API.info(e);
	        }
	
	};
  
	if(_args.isRegister == '0') {
		//alert(Ti.App.Properties.getString('login_password'))
	  txtHoTen.value =  Ti.App.Properties.getString('login_FullName')
	  txtDiaChi.value =  Ti.App.Properties.getString('login_Address')
	  txtEmail.value =  Ti.App.Properties.getString('login_email')
	  txtUser.value =  Ti.App.Properties.getString('login_username')
	  txtPass.value =  Ti.App.Properties.getString('login_password')
	  txtPassAgain.value =  Ti.App.Properties.getString('login_password')
	  btRegister.title= Globals.register_update
	  txtEmail.enabled=txtUser.enabled=false
	
	   if(Ti.Platform.osname == 'android') {
	   		if(Ti.App.Properties.getString('login_Sex')!=1)
	   		{
	   			txtGioiTinh.index=1;
	   		}
	   }
	   else
	   {
	   		if(Ti.App.Properties.getString('login_Sex')!=1)
	   		{
	   			txtGioiTinh.index=1;
	   		}
	   }
	}	
	
	
   
		
		
		
    return _args.view;
};                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           